package tcln.sors.service.core;


/**
 * Factory class for {@link ManagementService} lookup.
 * 
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
public interface ManagementServiceFactory {

    /**
     * Returns a service implementation for given object class.
     * 
     * @param <E>
     * @param objectClass
     * @return An implementation of {@link ManagementService} base on given object class. Notice that <code>null</code>
     *         may be returned depends on concrete implementations.
     */
    <E> ManagementService<E> getFor(Class<E> objectClass);

    /**
     * Returns a service implementation for given object class.
     * 
     * @param <E>
     * @param <S>
     * @param objectClass
     * @param targetServiceClass
     *            Target object class.
     * @return
     */
    <E, S extends ManagementService<E>> S getFor(Class<E> objectClass, Class<S> targetServiceClass);
}
